
target("agentspark")
    set_languages("c99", "c++11")
    set_kind("binary")

    on_load(function (target)
        import("lib.detect.find_package")

        target:add(find_package("rcssnet3D", {
            linkdirs={"$(env SPARK_DIR)/lib/simspark", "/usr/local/lib/simspark"},
            includedirs={"$(env SPARK_DIR)/include/simspark", "/usr/local/include/simspark"},
            links={"rcssnet3D"},
            includes={"rcssnet/addr.hpp"}
        }))
        target:add(find_package("boost_system"))
        target:add(find_package("pthread"))
    end)

    -- add files
    add_files(
        "main.cc",
        "behaviors/*.cc",
        "servercomm/*.cc",
        "parser/*.cc",
        "math/*.cc",
        "worldmodel/*.cc",
        "bodymodel/*.cc",
        "skills/*.cc",
        "ikfast/ikfast.cpp",
        "headers/*.cc",
        "audio/*.cc",
        "stats/*.cc",
        "kalman/*.cpp",
        "rvdraw/*.cc",
        "optimization/*.cc",
        "particlefilter/*.cc",
        "utwalk/**/*.cpp"

    )
    add_sysincludedirs("$(projectdir)/utwalk")

    add_links("dl", "rt")
